import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
let defaultCity ="长沙"
    if (localStorage.citys) {
      defaultCity =localStorage.citys
    }

const state={
	// vuex 属性值
	    city:defaultCity
}

const mutations={
	// vuex 组件方法
     changName(state,cityName){
         state.city=cityName
         // console.log(cityName)
         // alert(cityName)
         localStorage.citys=cityName

     }

}


export default new Vuex.Store({
      state,
      mutations
})
